package com.qf.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.AfterReturningAdvice;

import java.lang.reflect.Method;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf.advice
 * @Description:
 * @Date 2022/6/6 12:52
 */
public class MyAfterAdvice implements AfterReturningAdvice {

    /**
     * 后置通知:
     *      先执行核心业务方法, 也即是service中的增删改查方法
     *      再执行这个后置通知中的辅助功能方法: 例如提交事务, 打印日志等
     * @author 千锋健哥
     */
    public void afterReturning(Object o, Method method, Object[] objects, Object o1) throws Throwable {
        System.out.println("-----------提交事务AfterReturningAdvice 后置通知");

    }
}
